<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<sql:query var="rs" dataSource="jdbc/j2db">
	select * 
	from users
	   , depts
	   , userlevel 
	where users.dept_number = depts.dept_number 
	  and users.user_level = userlevel.user_level
	order by users.user_id asc
</sql:query>
<form action="modall" method="post">
	<input type="submit" value="修改資料">
	<br><br>
	<table border=1>
		<c:forEach var="r" items="${rs.rows }">
		
				<tr>
					<th>員工編號</th><td>${r.user_id }<input type="hidden" name="user_id" value="${r.user_id }" /></td>
					<th>員工頭像</th><td><input type="text" name="user_image" value="${r.user_image }" /></td>
				</tr>
				<tr>
				<th>員工姓名</th><td><input type="text" name="user_name" value="${r.user_name }" /></td>
				<th>員工密碼</th><td><input type="text" name="user_pw" value="${r.user_pw }" /></td>
				</tr>
				<tr>
				<th>性別</th><td><input type="radio" name="user_gender" value="男" checked />
					男 <input type="radio" name="user_gender" value="女" />女</td>
				<th>生日</th><td><input type="text" name="user_birthday" value="${r.user_birthday }" /></td>
				</tr>
				<tr>
				<th>家用電話</th><td><input type="text" name="user_tel" value="${r.user_tel }" /></td>
				<th>行動電話</th><td><input type="text" name="user_mobile" value="${r.user_mobile }" /></td>
				</tr>
				<tr>
				<th>地址</th><td><input type="text" name="user_address" value="${r.user_address }" /></td>
				</tr>
				<tr>
				<th>所屬部門</th><td><select name="dept_number">
					<option value="1">營業部</option>
					<option value="2">管理部</option>
				</select></td>
				<th>職稱</th><td><select name="user_level">
					<option value="1">董事會主席</option>
					<option value="2">執行長</option>
					<option value="3">總經理</option>
					<option value="4">副總經理</option>
					<option value="5">經理</option>
					<option value="6">副理</option>
					<option value="7">襄理</option>
					<option value="8">課長</option>
					<option value="9">科長</option>
					<option value="10">專員</option>
					<option value="11">科員</option>
					<option value="100">清潔工</option>
				</select></td>
				</tr>
				<tr>
				<th>基本薪資</th><td><input type="text" name="user_salary" value="${r.user_salary }" /></td>
				<th>任用日期</th><td><input type="text" name="user_employee" value="${r.user_employee }" /></td>
				</tr>
				<tr>
					<th>====================</th><th>====================</td>
					<th>====================</th><th>====================</td>
				</tr>
		</c:forEach>
	</table>
	<br><br>
	<input type="submit" value="修改資料">
</form>